Repository navigation
Decide where the name starts once, for title-particle heads (#624) - #633
Merged
Merged
Conversation
`freiherr` and `st` are both titles and particles, and such a word in
the leading titles is the particle chain's leading position (P4), so
the particle behind it is inside a name ('Freiherr von Berg'). Group's
chain found that position with a scan of its own that stopped at the
first such word and chained the second, while assign read both as
titles and the trailing read's unit count opened a unit inside the
titles to follow: 'Freiherr St John Smith MA' read family
'St John Smith' where 'Dr. St John Smith' reads title 'Dr. St', given
'John', family 'Smith'.
`_pieces.chain_lead` now gives the leading position once -- the last
title in assign's own title run that is also a particle, else the
first piece past it -- and group's chain and `_chain_units` both take
it. No unit opens inside the titles, so `_chain_units` loses its `at`
answer and its `q > k + 1` gate. Assign's re-read fallback stays: it
serves a connective join that makes the name a title, which this does
not touch.
Measured against 8e6e524: a title-particle head grid (137,810 names,
three orders) moves 5,785 parses, all two title-particles in the
leading run or H3's give-back before dual particles; the S2 grid moves
none; only the six case rows rewritten here move among corpus names
and case texts; the five gates exit 0. Every frame baseline moves down
by 4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #633 +/- ##
==========================================
- Coverage 99.01% 99.01% -0.01%
==========================================
Files 46 46
Lines 4488 4487 -1
==========================================
- Hits 4444 4443 -1
Misses 44 44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- chain_lead reads assign's title run before H3's give-back (Derek, the review's option (a)): a title handed back to the name because only suffix words follow it is still a title to the chain, so the particle behind it leads and chains nothing (P4). The first draft read the give-back as the lead, so `Dr. Mc Mc` chained its leading particle behind a plain title (title 'Dr.', family 'Mc Mc'), and a caller lexicon could make the group emitter fire behind one. It now reads as H3 states: given 'Dr.', suffix 'Mc Mc'. New row pins it. - rules.md: P4's clause says the LAST title-particle, limits itself to the leading titles and names the give-back (interacts gains H3); H4's Accepted example moves from `St St née` to `St van Bishop`. - decisions.md: the #624 entry records option (a), the first draft's readings, a comma-tail grid the first measurement missed (1,368 parses, all two title-particles past the second comma, now titles as C2 reads them), and the fallback guarding totality; the #614 and #620 entries point at #624 where they describe the removed mechanism. - Stale comments in _group.py, _pieces.py and test_group.py; the field sweep's control docstring names the right substitute row; the count moves 1146 -> 1149 (the new row), the control re-measured at 14. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- chain_lead's docstring and the decisions.md #624 entry: leading_titles also stops at a segment's last piece, which the `n + 1 < len(pieces)` test rules out; P4 says each title-particle reads as a title unless H3 gives it back. - The five ledgers' fix(#624) comments quoted P4's first-draft wording, which 07957c5 replaced; they now quote the current text. The excerpt check still scans only .py files (the follow-up task filed on #631). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
freiherrandstare both titles and particles (TITLES ∩ particles_ambiguous). Such a word in the leading titles is the particle chain's leading position (rules.md#P4), so the particle behind it is inside a name (Freiherr von Berg→ family 'von Berg'). Three places each decided where the name starts, and they disagreed when two such words stood together:_chain_units, Should S2's trailing read count the particle chain's units instead of merging a copy of them? #620) opened a unit inside the titles, to follow the chain.Dr. St John SmithFreiherr St John Smith MAFreiherr St van Berg MADr. St van Johnson)Freiherr von BergDecided by Derek: consistency and one shared answer, no special case for garbage.
_pieces.chain_leadgives the leading position once. It's the last title in assign's own title run that is also a particle, else the first piece past the run. Group's chain and_chain_unitsboth take it.leading_titlesstops at a leading title only where it gave that piece back, sochain_leadrecognises the give-back fromnalone, behind the same inline tag test._chain_unitsloses itsatanswer and itsq > k + 1gate, and group's chain drops its own scan.k <= leading). That's equivalent to the oldk == leadingwherever the lead was the first title-particle.Not done: the issue also proposed retiring assign's re-read fallback. Measured, it still does real work: disabled, sixteen or seventeen more tests fail (depending on how it's disabled), most of them crashing with an IndexError. So it guards totality, not just a reading. Among them is
a_title_read_before_the_chain_can_strand_the_name(Freiherr von Berg Dr. and Ed. Prof., a connective join that makes the name a title). It stays.Measured (decisions.md#P2, 2026-10-10)
Against master 8e6e524, py3.11,
nameparser.__file__asserted on each side:Freiherr St Dr. Sir Xyz. von van de do Mc John Smith MA PhD VI Prof. née Jr. and, plus comma forms. That's 137,810 names under three orders. Result: 5,964 role moves, and none in report text only.Dr. Freiherr St Mc→ family 'St', suffix 'Mc'; master family 'St Mc').Dr. Mc Mc→ given 'Dr.', suffix 'Mc Mc'). Master gave given 'Dr.', middle 'Mc', family 'Mc', because the read counted the second 'Mc' as bound into a run the chain never built.,, Freiherr Freiherr Bart→ title 'Freiherr Freiherr', suffix 'Bart').fix(#624)rule in each ledger.parse308 → 304 on 3.11 and 289 → 285 on 3.12–3.15;facade345 → 341 and 326 → 322. Re-recorded in_CALL_BASELINEand decisions.md#parse-cost.Tests
fix(#624), each note giving the earlier reading):Freiherr St van Berg MA,Freiherr Freiherr Prof do,St St VI,Freiherr St MA,Freiherr St Prof..Freiherr St John Smith MA, the issue's example, andDr. Mc Mc, which pins the give-back half.St St néetoSt van née(parity). It's the same structure with a chained particle that is not a title, sinceSt St néeno longer reaches that emitter.test_pieces.py:_chain_unitsreturns units only.test_the_chain_opens_no_unit_inside_the_titlesreplaces the test of the old design.Dr. Mc Mcadds three. Its control was re-measured against 26cdb89 over today's rows: still 14 failures, withFreiherr St John Smith MAin place ofSt St née.Docs
Freiherr St John Smith→ title 'Freiherr St', given 'John'.interacts:adds H3;implemented:adds_pieces.py.St St néetoSt van Bishop.Freiherr St John Smith MAstart: should a title that is also a particle open the name? #624 entry under P2;Review
c03f61e: the change.
07957c5: fixes the review:
Dr. Mc Mcchained its leading particle behind a plain title (title 'Dr.', family 'Mc Mc'), against P4, and a caller lexicon could make group's emitter fire behind a plain title.12ef837: the fix commit's review nits:
chain_lead's docstring and the decisions entry note thatleading_titlesalso stops at a segment's last piece, P4 says a title-particle reads as a title unless H3 gives it back, and the five ledger comments quote P4's current wording (they had kept the first draft's).Closes #624
🤖 Generated with Claude Code